package com;

import com.zhuxin.common.MessageListener;
import com.zhuxin.common.PropertiesListener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.util.Map;

@SpringBootApplication
@ServletComponentScan
@EnableScheduling//开启定时任务
@EnableTransactionManagement
@EnableAutoConfiguration(exclude={
		DataSourceAutoConfiguration.class,
		DataSourceTransactionManagerAutoConfiguration.class,
})
public class CommWxApplication {

	public static ThreadLocal<Map<String, Object>> threadMap= new ThreadLocal<>();
	public static ApplicationContext ctx;
	public static void main(String[] args) {
		SpringApplication app=new SpringApplication(CommWxApplication.class);
		app.addListeners(new PropertiesListener("wx.properties"));
		app.addListeners(new MessageListener());
		ctx=app.run(args);
	}
}
